<template>
  <div class="index">
    <div class="wrapbox">
      <div class="mainbox">
        <!-- 子系统导航模块 -->
        <el-row :gutter="40" class="panel-group">
          <!-- 模块一 -->
          <el-col
            :xs="8"
            :sm="8"
            :lg="8"
            class="card-panel-col"
            v-if="moduleId==0 || moduleId==1 ?true:false"
          >
            <div @click="toPage(1)" class="mainboxItem">
              <div class="optionCard opcard1" shadow="hover" ref="optionCard1">
                <div class="imgbox">
                  <i class="el-icon-setting"></i>
                </div>
                <div class="pbox">
                  <p>铁路智慧轮轴检修管理系统</p>
                </div>
              </div>
            </div>
          </el-col>
          <!-- 模块二 -->
          <el-col
            :xs="8"
            :sm="8"
            :lg="8"
            class="card-panel-col"
            v-if="moduleId==0 || moduleId==2 ?true:false"
          >
            <div @click="toPage(2)" class="mainboxItem step2">
              <div class="optionCard opcard3" shadow="hover" ref="optionCard2">
                <div class="imgbox">
                  <i class="el-icon-bell"></i>
                </div>
                <div class="pbox">
                  <p>铁路轮轴智能组装系统</p>
                </div>
              </div>
            </div>
          </el-col>
          <!-- 模块三 -->
          <el-col
            :xs="8"
            :sm="8"
            :lg="8"
            class="card-panel-col"
            v-if="moduleId==0 || moduleId==3 ?true:false"
          >
            <div @click="toPage(3)" class="mainboxItem step3">
              <div class="optionCard opcard5" shadow="hover" ref="optionCard3">
                <div class="imgbox">
                  <i class="el-icon-brush"></i>
                </div>
                <div class="pbox">
                  <p>网络修车系统</p>
                </div>
              </div>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
import echarts from "echarts";
// 指定图表的配置项和数据
let option1 = {
  xAxis: {
    data: [
      "一月",
      "二月",
      "三月",
      "四月",
      "五月",
      "六月",
      "七月",
      "八月",
      "九月",
      "十月",
      "十一月",
      "十二月",
    ],
    type: "category",
    boundaryGap: false,
    axisTick: {
      show: false,
    },
  },
  grid: {
    left: 10,
    right: 20,
    bottom: 20,
    top: 30,
    containLabel: true,
  },
  tooltip: {
    trigger: "axis",
    axisPointer: {
      type: "cross",
    },
    padding: [5, 10],
  },
  yAxis: [
    {
      axisTick: {
        show: false,
      },
      splitArea: {
        show: true,
        areaStyle: {
          color: ["rgba(255,255,255,0.3)", "rgba(241,241,241,0.3)"],
        },
      },
    },
  ],
  legend: {
    data: ["分享数", "点赞数"],
  },
  series: [
    {
      name: "分享数",
      itemStyle: {
        normal: {
          color: "#FF005A",
          lineStyle: {
            color: "#FF005A",
            width: 2,
          },
        },
      },
      smooth: true,
      type: "line",
      data: [10, 50, 42, 15, 5, 48, 5, 45, 12, 545, 120, 520],
      animationDuration: 2800,
      animationEasing: "cubicInOut",
    },
    {
      name: "点赞数",
      smooth: true,
      type: "line",
      itemStyle: {
        normal: {
          color: "#3888fa",
          lineStyle: {
            color: "#3888fa",
            width: 2,
          },
          areaStyle: {
            color: "#f3f8ff",
          },
        },
      },
      data: [100, 500, 420, 150, 50, 480, 50, 45, 120, 502, 100, 580],
      animationDuration: 2800,
      animationEasing: "quadraticOut",
    },
  ],
};
export default {
  name: "index",
  data() {
    return {
      moduleId: null,
    };
  },
  mounted() {},
  created() {
    this.moduleId = this.$route.query.type;
  },
  methods: {
    // 跳转页面
    toPage(type) {
      this.$router.push({
        name: "Home",
        query: { type },
      });
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.index {
  height: 100%;
  background: #f0f2f5;
  background-image: url("../assets/bg.jpg");
  background-size: 100% 100%;
}
.panel-group {
  /* margin-top: 18px; */
}
.card-panel-col {
  margin-bottom: 40px;
  position: relative;
}
.el-badge {
  width: 100%;
}
.wrapbox {
  height: 100%;
  overflow: hidden;
  position: relative;
}
.mainbox {
  width: 94%;
  min-width: 350px;
  padding: 18px 3%;
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(0, -20%);
}

.pbox {
  width: 45%;
  margin-right: 15px;
}
.pbox p:nth-child(1) {
  font-size: 1em;
  color: rgba(0, 0, 0, 0.45);
  font-weight: bold;
}
.pbox p:nth-child(2) {
  font-size: 1em;
  color: #666;
  font-weight: bold;
}
.optionCard {
  height: 108px;
  border: 1px solid #eee;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-right: -5px;
  margin-top: -5px;
  transition: all 0.5s;
}
.optionCard:hover {
  box-shadow: 0 0 10px #24a1a7;
}
.opcard1 {
  margin-left: 0px;
}
.opcard1 .imgbox i {
  color: #ffb980;
}
.opcard1:hover .imgbox {
  background: #ffb980;
  border-radius: 10px;
  transition: all 1s;
}
.opcard1:hover .imgbox i {
  color: white;
  transition: all 1s;
}
.opcard2 .imgbox i {
  color: #b6a2de;
}
.opcard2:hover .imgbox {
  background: #b6a2de;
  border-radius: 10px;
  transition: all 1s;
}
.opcard2:hover .imgbox i {
  color: white;
  transition: all 1s;
}
.opcard3 .imgbox i {
  color: #5ab1ef;
}
.opcard3:hover .imgbox {
  background: #5ab1ef;
  border-radius: 10px;
  transition: all 1s;
}
.opcard3:hover .imgbox i {
  color: white;
  transition: all 1s;
}
.opcard4 .imgbox i {
  color: #5ab1ef;
}
.opcard4:hover .imgbox {
  background: #5ab1ef;
  border-radius: 10px;
  transition: all 1s;
}
.opcard4:hover .imgbox i {
  color: white;
  transition: all 1s;
}
.opcard5 .imgbox i {
  color: #34bfa3;
}
.opcard5:hover .imgbox {
  background: #34bfa3;
  border-radius: 10px;
  transition: all 1s;
}
.opcard5:hover .imgbox i {
  color: white;
  transition: all 1s;
}
.opcard6 .imgbox i {
  /* color: #ffb980; */
  color: #eeeeee;
}
/* .opcard6:hover .imgbox {
  background: #ffb980;
  border-radius: 10px;
  transition: all 1s;
}
.opcard6:hover .imgbox i {
  color: white;
  transition: all 1s;
} */
.optionCard p {
  line-height: 30px;
  text-align: center;
}
.imgbox {
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  margin: 0px 15px;
  padding: 15px;
  /* background: #409eff; */
}
.imgbox i {
  font-size: 40px;
  color: #409eff;
}
.echartsBox {
  /* margin-top: 40px; */
  width: 100%;
  padding: 0px 20px;
  padding-top: 20px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  box-sizing: border-box;
}
.echartsBox2 {
  margin-top: 40px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.minitu {
  /* width: 29.7%; */
  height: 316px;
  /* padding: 0px 20px; */
  padding: 16px 16px 0;
  padding-top: 40px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}
.charts1 {
  padding-right: 20px;
}
.charts2 {
  padding: 0px 20px;
}
.charts3 {
  padding-left: 20px;
}
@media screen and (max-width: 1420px) {
  .imgbox {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    margin: 0px 15px;
    padding: 10px;
    /* background: #409eff; */
  }
  .imgbox i {
    font-size: 30px;
    color: #409eff;
  }
}
@media screen and (max-width: 1295px) {
  .imgbox {
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    margin: 0px 15px;
    padding: 10px;
    /* background: #409eff; */
  }
  .imgbox i {
    font-size: 60px;
    color: #409eff;
  }
  .pbox p:nth-child(1) {
    font-size: 20px;
  }
  .pbox p:nth-child(2) {
    font-size: 14px;
  }
}
/* 平板 */
@media only screen and (max-width: 1200px) {
  .el-col-sm-12 {
    width: 50%;
  }
  .charts1,
  .charts2,
  .charts3 {
    padding: 0px;
  }
  .charts2 {
    margin: 40px 0px;
  }
  .pbox p:nth-child(1) {
    font-size: 20px;
  }
  .pbox p:nth-child(2) {
    font-size: 20px;
  }
  .imgbox {
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    margin: 0px 15px;
    padding: 10px;
    /* background: #409eff; */
  }
  .imgbox i {
    font-size: 40px;
    color: #409eff;
  }
}
/* 手机 */
@media only screen and (max-width: 768px) {
  .el-col-sm-12 {
    width: 50%;
  }
  .pbox {
    display: none;
  }
  .imgbox {
    width: 100%;
    height: 100%;
    line-height: 110px;
    padding: 0px;
    margin: 0px;
    border-radius: 0 !important;
  }
  .imgbox i {
    font-size: 50px;
  }
  /* .opcard1:hover .imgbox{
    height:100%;
  } */
}
@media only screen and (max-width: 480px) {
  .mainbox {
    padding: 0px;
  }
}
</style>
